<head>
<script>
function runTest() {
    if (window.testRunner)
        testRunner.dumpAsText();
    window.getSelection().collapse(document.body, 0);
    document.execCommand("InsertText", false, "foo");
    div = document.createElement("div");
    div.appendChild(document.createTextNode("x"));
    document.body.appendChild(div);
    div.style.height = "0px";
    div.style.overflow = "hidden";
    document.execCommand("JustifyRight");
    document.body.removeChild(div);
    document.body.innerHTML = "<div align='right'>This tests for a crash on Undo that was caused because of DOM operations that GMail performs while right aligning text. This text should be right aligned and this test should not crash.</div>";
    document.execCommand("Undo");
}
</script>
</head>
<body contentEditable="true" onLoad="runTest();"></body>
